Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Storage Messages


GXInitialize

QuickDraw GX sends the GXInitialize message at the start of a new printing job. You can override the GXInitialize message to perform any initialization your message handler needs to carry out its tasks. Your override of the GXInitialize message must match the following formal declaration:

OSErr MyInitialize (void);
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX sends the GXInitialize message at the start of a new printing job, just after the application has called the GXNewJob function.

You can override the GXInitialize message to perform any necessary initialization and to allocate storage for your extension or driver. GXInitialize is the first message a message handler receives after it is loaded into the message chain. If you need to allocate storage for global data in your override of GXInitialize, you need to call the NewHandle function and store the handle by calling the SetMessageHandlerInstanceContext function. Or you can call the NewMessageGlobals function to set up a globals environment to access so that you can access the global data. This stores the handle into the context for any other messages that you override. .

The default implementation of the GXInitialize message allocates memory needed by QuickDraw GX in its default implementation of the printing messages.

SPECIAL CONSIDERATIONS
You never send the GXInitialize message yourself.

You never forward the GXInitialize message.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found, or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
SEE ALSO
You can find examples of overrides of the GXInitialize message in Listing 2-6 on page 2-16 in the chapter "Printing Extensions" and in Listing 3-4 on page 3-24 in the chapter "Printer Drivers."

The GXNewJob function is described in Inside Macintosh: QuickDraw GX Printing.

The NewHandle function is described in Inside Macintosh: Memory. The NewMessageGlobals function is described in the chapter "Message Manager" in Inside Macintosh: QuickDraw GX Environment and Utilities.

The SetMessageHandlerInstanceContext function is described in Inside Macintosh: Processes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help